<template>
    <div class="searchtag">
      <div class="searchtagall">
        <div v-for="item of tagList" :class="{active:item.active}" :navlist="{navlist:item.navlist}" @click="searchtag(item);":key="item.id">{{item.title}}</div>
      </div>
    </div>
</template>

<script>
export default {
  name: '',
  data () {
    return {
      tagList: [
        {title: '金融股权', active: true, methodname: 'getAssetsFinance', index:0},
        {title: '实物资产', active: false, methodname: 'getAssetsMaterial', index:0},
        {title: '不良债权', active: false, methodname: 'getAssetsUnhealthy', index:0},
        {title: '招商项目', active: false, methodname: 'getAssetsAttract', index:0}
      ]
    }
  },
  methods: {
    searchtag (data) {
      this.tagList.forEach(function (obj) {
        obj.active = false
      })
      data.active = !data.active
      //
      this.AssetsType.methodname = data.methodname
      this.AssetsType.index = 0
      //事件总线
      this.bus.$emit('change')
    }
  },
  mounted () {
    //默认
    this.bus.$emit('change')
  },
  beforeDestroy () {
    this.bus.$off('change')
  }
}
</script>

<style scoped type="text/stylus" lang="stylus">
.searchtag
  width:1200px;height:50px;border-bottom:1px solid #ccc;line-height:50px;margin:0 auto;
  .searchtagall
    height:20px;border-left:3px solid #BA9959;line-height:20px;margin-top:20px;
  div
    float:left;height:20px;text-align:center;line-height:20px;font-size:16px;padding:0 10px;cursor :pointer
  .active
    color:#ba9b85;border-bottom:1px solid #BA9959;padding-bottom:11px;
</style>
